webpackJsonp([65],{

/***/ "4C3E":
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });

// EXTERNAL MODULE: ./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/extends.js
var helpers_extends = __webpack_require__("4YfN");
var extends_default = /*#__PURE__*/__webpack_require__.n(helpers_extends);

// EXTERNAL MODULE: ./node_modules/_babel-runtime@6.26.0@babel-runtime/regenerator/index.js
var regenerator = __webpack_require__("lC5x");
var regenerator_default = /*#__PURE__*/__webpack_require__.n(regenerator);

// EXTERNAL MODULE: ./node_modules/_babel-runtime@6.26.0@babel-runtime/core-js/promise.js
var promise = __webpack_require__("rVsN");
var promise_default = /*#__PURE__*/__webpack_require__.n(promise);

// EXTERNAL MODULE: ./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/slicedToArray.js
var slicedToArray = __webpack_require__("KH7x");
var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray);

// EXTERNAL MODULE: ./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/asyncToGenerator.js
var asyncToGenerator = __webpack_require__("J0Oq");
var asyncToGenerator_default = /*#__PURE__*/__webpack_require__.n(asyncToGenerator);

// EXTERNAL MODULE: ./src/common/utils/index.js
var utils = __webpack_require__("dh3M");

// EXTERNAL MODULE: ./src/common/api/commonApi.js
var commonApi = __webpack_require__("+/+p");

// CONCATENATED MODULE: ./node_modules/_babel-loader@7.1.5@babel-loader/lib!./node_modules/_vue-loader@13.7.3@vue-loader/lib/selector.js?type=script&index=0!./src/common/anjian/law/add.vue





//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//




/* harmony default export */ var add = ({
  data: function data() {
    return {
      form: {},
      entList: [],
      categoryList: [],
      shortList: []
    };
  },
  activated: function activated() {
    this.fetchData();
  },

  methods: {
    fetchData: function fetchData() {
      var _this = this;

      return asyncToGenerator_default()( /*#__PURE__*/regenerator_default.a.mark(function _callee() {
        var p, _ref, _ref2, ent, _ref2$, categroy, short;

        return regenerator_default.a.wrap(function _callee$(_context) {
          while (1) {
            switch (_context.prev = _context.next) {
              case 0:
                p = [commonApi["a" /* commonApi */].search('ent_enterprise'), commonApi["a" /* commonApi */].dictionaries(['enterprise_category', 'category_short'])];
                _context.next = 3;
                return promise_default.a.all(p);

              case 3:
                _ref = _context.sent;
                _ref2 = slicedToArray_default()(_ref, 2);
                ent = _ref2[0];
                _ref2$ = slicedToArray_default()(_ref2[1], 2);
                categroy = _ref2$[0];
                short = _ref2$[1];

                _this.entList = ent;
                _this.categoryList = categroy;
                _this.shortList = short;

              case 12:
              case 'end':
                return _context.stop();
            }
          }
        }, _callee, _this);
      }))();
    },
    submit: function submit(loaded) {
      var _this2 = this;

      return asyncToGenerator_default()( /*#__PURE__*/regenerator_default.a.mark(function _callee2() {
        var form;
        return regenerator_default.a.wrap(function _callee2$(_context2) {
          while (1) {
            switch (_context2.prev = _context2.next) {
              case 0:
                _context2.prev = 0;
                form = Object(utils["a" /* BuildPointer */])(_this2.form, {
                  plan_enterprise: 'ent_enterprise'
                });
                _context2.next = 4;
                return commonApi["a" /* commonApi */].save('law_plan', extends_default()({}, form, { state: 0 }));

              case 4:
                _this2.$router.$back();
                _this2.$Toast('新增成功!', 'success');
                _context2.next = 11;
                break;

              case 8:
                _context2.prev = 8;
                _context2.t0 = _context2['catch'](0);

                _this2.$Toast('新增失败!', 'error');

              case 11:
                loaded();

              case 12:
              case 'end':
                return _context2.stop();
            }
          }
        }, _callee2, _this2, [[0, 8]]);
      }))();
    }
  }
});
// CONCATENATED MODULE: ./node_modules/_vue-loader@13.7.3@vue-loader/lib/template-compiler?{"id":"data-v-a00fc64e","hasScoped":false,"transformToRequire":{"video":["src","poster"],"source":"src","img":"src","image":"xlink:href"},"buble":{"transforms":{}}}!./node_modules/_vue-loader@13.7.3@vue-loader/lib/selector.js?type=template&index=0!./src/common/anjian/law/add.vue
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('yt-page',{attrs:{"title":"新增执法企业"}},[_c('yt-cell',{attrs:{"label":"单位名称"}},[_c('yt-cell-select',{attrs:{"list":_vm.entList,"label":"EnterpriseName","val":"id"},model:{value:(_vm.form.plan_enterprise),callback:function ($$v) {_vm.$set(_vm.form, "plan_enterprise", $$v)},expression:"form.plan_enterprise"}})],1),_vm._v(" "),_c('yt-cell',{attrs:{"label":"检查时间"}},[_c('yt-cell-time',{attrs:{"format":"YYYY-MM"},model:{value:(_vm.form.plan_time),callback:function ($$v) {_vm.$set(_vm.form, "plan_time", $$v)},expression:"form.plan_time"}})],1),_vm._v(" "),_c('yt-cell',{attrs:{"label":"企业类别"}},[_c('yt-cell-select',{attrs:{"list":_vm.categoryList,"label":"D_text","val":"D_code"},model:{value:(_vm.form.enterprise_category),callback:function ($$v) {_vm.$set(_vm.form, "enterprise_category", $$v)},expression:"form.enterprise_category"}})],1),_vm._v(" "),_c('yt-cell',{attrs:{"label":"类别简称"}},[_c('yt-cell-select',{attrs:{"list":_vm.shortList,"label":"D_text","val":"D_code"},model:{value:(_vm.form.category_short),callback:function ($$v) {_vm.$set(_vm.form, "category_short", $$v)},expression:"form.category_short"}})],1),_vm._v(" "),_c('yt-btn',{staticClass:"m-t",attrs:{"loading":_vm.submit}},[_vm._v("提交")])],1)}
var staticRenderFns = []
var esExports = { render: render, staticRenderFns: staticRenderFns }
/* harmony default export */ var law_add = (esExports);
// CONCATENATED MODULE: ./src/common/anjian/law/add.vue
var normalizeComponent = __webpack_require__("C7Lr")
/* script */


/* template */

/* template functional */
var __vue_template_functional__ = false
/* styles */
var __vue_styles__ = null
/* scopeId */
var __vue_scopeId__ = null
/* moduleIdentifier (server only) */
var __vue_module_identifier__ = null
var Component = normalizeComponent(
  add,
  law_add,
  __vue_template_functional__,
  __vue_styles__,
  __vue_scopeId__,
  __vue_module_identifier__
)

/* harmony default export */ var anjian_law_add = __webpack_exports__["default"] = (Component.exports);


/***/ })

});